package com.chenfengyao.gamereversi.ai

import com.chenfengyao.gamereversi.core.ChessPiece
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

/**
 * Created by 陈丰尧 on 2024/12/5
 */

class ComputerPlayer {

    var difficulty: AIDifficulty = AIDifficulty.MEDIUM

    /**
     * 获取下一步
     */
    suspend fun getNextStep(
        chessBoard: Array<Array<ChessPiece>>,
        player: ChessPiece
    ): Pair<Int, Int> {
        if (player == ChessPiece.NONE) return -1 to -1
        return withContext(Dispatchers.Default) {
            AISearch.findBestMove(chessBoard, player, difficulty)
        }
    }






}